package com.edfu.core.coursemgt.persistence.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="lessoninstance")
public class LessonInstanceEntity implements ICourseMgtEntity {
	private long id;
	private LessonEntity lesson;
	private CourseOfferingInstanceEntity courseOfferingInstance;
	private int lessonInstanceNo;
	private String contentDirectory;
	private String status;
	private boolean visible;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name = "lesson_id", nullable = false)
	public LessonEntity getLesson() {
		return lesson;
	}
	public void setLesson(LessonEntity lesson) {
		this.lesson = lesson;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "courseofferinginstance_id", nullable = false)
	public CourseOfferingInstanceEntity getCourseOfferingInstance() {
		return courseOfferingInstance;
	}
	public void setCourseOfferingInstance(CourseOfferingInstanceEntity courseOfferingInstance) {
		this.courseOfferingInstance = courseOfferingInstance;
	}
	public int getLessonInstanceNo() {
		return lessonInstanceNo;
	}
	public void setLessonInstanceNo(int lessonInstanceNo) {
		this.lessonInstanceNo = lessonInstanceNo;
	}
	public String getContentDirectory() {
		return contentDirectory;
	}
	public void setContentDirectory(String contentDirectory) {
		this.contentDirectory = contentDirectory;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public boolean isVisible() {
		return visible;
	}
	public void setVisible(boolean visible) {
		this.visible = visible;
	}
}
